import { request } from '@/api/service'
// export const urlPrefix = '/api/process/processManagement/'
export const urlPrefix = '/scheduling/graph/'
/**
 * 列表查询
 */
export function GetList (query) {
  // query.limit = 999;
  return request({
    url: urlPrefix,
    method: 'get',
    params: query
  })
}

/**
 * 新增
 */
export function createObj (obj) {
  return request({
    url: urlPrefix,
    method: 'post',
    data: obj
  })
}

/**
 * 修改
 */
export function UpdateObj (obj) {
  return request({
    url: urlPrefix + obj.id + '/',
    method: 'put',
    data: obj
  })
}
/**
 * 删除
 */
export function DelObj (id) {
  return request({
    url: urlPrefix + id + '/',
    method: 'delete',
    data: { id }
  })
}
export function getConfig (obj) {
  return request({
    url: '/api/get_configurable_nodes' + '/' + obj,
    method: 'get',
    data: obj
  })
}

export function saveRouteConfig (obj) {
  return request({
    url: '/api/create_api/',
    method: 'post',
    data: obj
  })
}

export function getRouteConfig (objId) {
  return request({
    url: '/api/get_algorithm/' + objId + '/',
    method: 'put'
  })
}
